package com.tydic.order.enums;

import cn.hutool.core.text.CharSequenceUtil;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum OrderStatus {
    ALL("-1"), WAIT_SIGN("0"), CANCEL("1"), WAIT_PAY("2"), WAIT_TAKE_OVER("3"), TAKE_OVER("4"), COMPLETE("5"), WAIT_DELIVER("6");

    private final String status;

    public static OrderStatus of(String status) {
        for (OrderStatus item : values()) {
            if (CharSequenceUtil.equals(item.getStatus(), status)) {
                return item;
            }
        }
        return null;
    }
}
